home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / X11 / config / nto.rules < prev    next >
Text File  |  2006-04-12  |  8KB  |  241 lines

  1. XCOMM $XFree86: xc/config/cf/nto.rules,v 1.7 2003/10/09 22:43:18 herrb Exp $ 
  2. XCOMM Rules for QNX/Neutrino
  3. XCOMM Note that some of these will disappear when we stop cross-compiling
  4.  
  5. #ifndef HasSharedLibraries
  6. #define HasSharedLibraries YES
  7. #endif
  8.  
  9. #ifndef SharedDataSeparation
  10. #define SharedDataSeparation NO
  11. #endif
  12. #ifndef SharedCodeDef
  13. #define SharedCodeDef /**/
  14. #endif
  15. #ifndef SharedLibraryDef
  16. #define SharedLibraryDef /**/
  17. #endif
  18. #ifndef SharedLibraryLoadFlags
  19. #define SharedLibraryLoadFlags -shared
  20. #endif
  21. #ifndef PositionIndependentCFlags
  22. #define PositionIndependentCFlags -fPIC
  23. #endif
  24. #ifndef PositionIndependentCplusplusFlags
  25. #define PositionIndependentCplusplusFlags -fPIC
  26. #endif
  27.  
  28. #define LinkFile(tofile, fromfile)                @@\
  29. tofile:: fromfile                        @@\
  30.     $(CP) fromfile tofile                    @@\
  31.                                 @@\
  32. includes:: tofile                        @@\
  33.                                 @@\
  34. depend:: tofile                            @@\
  35.                                 @@\
  36. clean::                                @@\
  37.     RemoveFile(tofile)
  38.  
  39. #define ObjectFromSpecialSource(dst, src, flags)        @@\
  40. NoConfigRec(dst.c)                        @@\
  41.                                 @@\
  42. dst.c: src.c                            @@\
  43.     RemoveFile($@)                        @@\
  44.     $(CP) $? $@                        @@\
  45.                                 @@\
  46. SpecialCObjectRule(dst,NullParameter,flags)            @@\
  47.                                 @@\
  48. includes:: dst.c                        @@\
  49.                                 @@\
  50. depend:: dst.c                            @@\
  51.                                 @@\
  52. clean::                                @@\
  53.     RemoveFile(dst.c)
  54.  
  55.  
  56. #define ObjectFromSpecialAsmSource(dst, src, flags)        @@\
  57. dst.S: src.S                            @@\
  58.     RemoveFile($@)                        @@\
  59.     $(CP) $? $@                        @@\
  60.                                 @@\
  61. dst.o: dst.S                            @@\
  62.     AssembleObject(flags)                    @@\
  63.                                 @@\
  64. dst.i: dst.S                            @@\
  65.     CPPOnlyAsm(dst,flags)                    @@\
  66.                                 @@\
  67. depend:: dst.S                            @@\
  68.                                 @@\
  69. clean::                                @@\
  70.     RemoveFile(dst.S)
  71.  
  72. XCOMM Special rule ComplexHostProgramTarget needed to compile 
  73. XCOMM our utilities locally because we are cross-compiling...
  74. XCOMM
  75.  
  76. #define ComplexHostProgramTarget(program)            @@\
  77.            CC=cc                        @@\
  78.            STD_INCLUDES =                    @@\
  79.            CFLAGS=$(TOP_INCLUDES) $(INCLUDES) $(BOOTSTRAPCFLAGS)    @@\
  80.            CCOPTIONS =                        @@\
  81.            EXTRA_LOAD_FLAGS =                    @@\
  82.            PROGRAM = program                    @@\
  83.                                 @@\
  84. AllTarget(program)                        @@\
  85.                                 @@\
  86. program: $(OBJS) $(DEPLIBS)                    @@\
  87.     RemoveTargetProgram($@)                    @@\
  88.     HostLinkRule($@,$(_NOOP_),$(OBJS),$(DEPLIBS) $(LOCAL_LIBRARIES)) @@\
  89.                                 @@\
  90. DependTarget()                            @@\
  91.                                 @@\
  92. clean::                                @@\
  93.     RemoveFile(ProgramTargetName(program))
  94.  
  95. XCOMM And this rule is again for a host simple host program when cross-compiling.
  96. XCOMM
  97.  
  98. #define SimpleHostProgramTarget(program)            @@\
  99.          OBJS = program.o                    @@\
  100.          SRCS = program.c                    @@\
  101.                                 @@\
  102. ComplexHostProgramTarget(program)
  103.     
  104.  
  105. #ifndef FixupLibReferences
  106. #define FixupLibReferences()                        @@\
  107. XMULIBONLY = -lXmu                            @@\
  108. XMULIB = $(XMULIBONLY) $(XTOOLLIB) $(XLIB)
  109. #endif
  110.  
  111. #ifndef SharedLibraryTarget
  112. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  113. AllTarget(Concat(lib,libname.so.rev))                    @@\
  114.                                     @@\
  115. Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)            @@\
  116.     $(RM) $@~                            @@\
  117.     @SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; set -x; \        @@\
  118.         (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  119.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  120.         LinkBuildSonameLibrary($$SONAME)            @@\
  121.     $(RM) $@                             @@\
  122.     $(MV) $@~ $@                            @@\
  123.     @if $(SOSYMLINK); then (set -x; \                @@\
  124.       $(RM) Concat(lib,libname.so); \                @@\
  125.      $(LN) $@ Concat(lib,libname.so)); fi                @@\
  126.     LinkBuildLibrary($@)                        @@\
  127.     LinkBuildLibrary(Concat(lib,libname.so))            @@\
  128.                                     @@\
  129. clean::                                    @@\
  130.     @MAJREV=`echo rev | sed 's/\.[^\.]*$$//'`; \            @@\
  131.     set -x; $(RM) Concat(lib,libname.so.$$MAJREV)            @@\
  132.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  133. #endif
  134. /*
  135.  * InstallSharedLibrary - generate rules to install the shared library.
  136.  * NOTE: file must be executable, hence "INSTBINFLAGS"
  137.  */
  138. #ifndef InstallSharedLibrary
  139. #define    InstallSharedLibrary(libname,rev,dest)                @@\
  140. install:: Concat(lib,libname.so.rev)                     @@\
  141.     MakeDir($(DESTDIR)dest)                        @@\
  142.     $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  143.     @T=`echo Concat($(DESTDIR)dest/lib,libname.so.rev) | sed 's/\.[^\.]*$$//'`;\
  144.       set -x; $(RM) $$T && $(LN) Concat(lib,libname.so.rev) $$T    @@\
  145.     @if $(SOSYMLINK); then (set -x; \
  146.       $(RM) Concat($(DESTDIR)dest/lib,libname.so); \        @@\
  147.       $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)); fi
  148. #endif /* InstallSharedLibrary */
  149.  
  150. /*
  151.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  152.  */
  153. #ifndef SharedLibraryDataTarget
  154. #define SharedLibraryDataTarget(libname,rev,salist)
  155. #endif /* SharedLibraryTarget */
  156.  
  157. /*
  158.  * InstallSharedLibraryData - generate rules to install the shared library data
  159.  */
  160. #ifndef InstallSharedLibraryData
  161. #define    InstallSharedLibraryData(libname,rev,dest)
  162. #endif /* InstallSharedLibraryData */
  163.  
  164. #define BaseShLibReqs
  165.  
  166.  
  167.  
  168. /*
  169.  * ServerTargetWithFlags - generate rules to compile, link, and relink a server
  170.  */
  171. #ifndef ServerTargetWithFlags
  172. #define    ServerTargetWithFlags(server,subdirs,objects,libs,syslibs,flags) @@\
  173. AllTarget(ProgramTargetName(server))                    @@\
  174. ProgramTargetName(server): subdirs objects libs                @@\
  175.     MoveToBakFile($@)                        @@\
  176.     LinkRule($@,$(LDOPTIONS),objects,libs $(LDLIBS) syslibs)     @@\
  177.                                     @@\
  178. Concat(load,server):                            @@\
  179.     MoveToBakFile(ProgramTargetName(server))            @@\
  180.     LinkRule(ProgramTargetName(server),$(LDOPTIONS),objects,libs $(LDLIBS) syslibs) @@\
  181.                                     @@\
  182. loadX:: Concat(load,server)                        @@\
  183.                                     @@\
  184. SentinelProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
  185. SentinelLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
  186. PurifyProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
  187. PurifyLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
  188. ProofProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
  189. ProofLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
  190.                                     @@\
  191. InstallProgramWithFlags(server,$(BINDIR),flags)                @@\
  192.                                     @@\
  193. clean::                                    @@\
  194.     RemoveFile(ProgramTargetName(server))
  195. #endif /* ServerTargetWithFlags */
  196.  
  197. /*
  198.  * SharedDepLibraryTarget - generate rules to create a shared library.
  199.  */
  200. #ifndef SharedDepLibraryTarget
  201. #define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up)    @@\
  202. AllTarget(Concat(lib,libname.so.rev))                    @@\
  203.                                     @@\
  204. Concat(lib,libname.so.rev):  deplist $(EXTRALIBRARYDEPS)        @@\
  205.     $(RM) $@~                            @@\
  206.     @SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; set -x; \        @@\
  207.         (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  208.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  209.         LinkBuildSonameLibrary($$SONAME)            @@\
  210.     $(RM) $@                             @@\
  211.     $(MV) $@~ $@                            @@\
  212.     @if $(SOSYMLINK); then (set -x; \                @@\
  213.       $(RM) Concat(lib,libname.so); \                @@\
  214.       $(LN) $@ Concat(lib,libname.so)); fi                @@\
  215.     LinkBuildLibrary($@)                        @@\
  216.     LinkBuildLibraryMaybe(Concat(lib,libname.so),$(SOSYMLINK))    @@\
  217.                                     @@\
  218. clean::                                    @@\
  219.     @MAJREV=`echo rev | sed 's/\.[^\.]*$$//'`; \            @@\
  220.     set -x; $(RM) Concat(lib,libname.so.$$MAJREV)            @@\
  221.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  222.  
  223. #endif /* SharedDepLibraryTarget */
  224.  
  225. #ifndef SharedDepModuleTarget
  226. #define SharedDepModuleTarget(name,deps,solist)                @@\
  227. AllTarget(name)                                @@\
  228.  
  229.                                     @@\
  230. name: deps                                @@\
  231.     $(RM) $@~                            @@\
  232.     $(CC) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
  233.     $(RM) $@                            @@\
  234.     $(MV) $@~ $@                            @@\
  235.                                     @@\
  236. clean::                                    @@\
  237.     $(RM) name
  238.  
  239. #endif /* SharedDepModuleTarget */
  240.  
  241.